package com.example.test;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class feture01 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        FutureTask<String> futureTask = new FutureTask<>(new myTread());
        Thread t1 = new Thread(futureTask);
        t1.start();
        System.out.println(futureTask.get());
    }
}

class myTread implements Callable<String>{
    @Override
    public String call() throws Exception {
        System.out.println("-----------come in----------");
        return "hello Callable";
    }
}
